package com.youyi.yyviewsdklibrary.Dialog.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;
import com.youyi.yyviewsdklibrary.Dialog.util.XPopupUtils;

public class CheckView extends View {
    int color;
    Paint paint;
    Path path;

    public CheckView(Context context) {
        this(context, null);
    }

    public CheckView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public CheckView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.color = 0;
        this.path = new Path();
        Paint paint2 = new Paint(1);
        this.paint = paint2;
        paint2.setStrokeWidth((float) XPopupUtils.dp2px(context, 2.0f));
        this.paint.setStyle(Paint.Style.STROKE);
    }

    public void setColor(int i) {
        this.color = i;
        this.paint.setColor(i);
        postInvalidate();
    }

    /* access modifiers changed from: protected */
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if (this.color != 0) {
            this.path.moveTo((float) (getMeasuredWidth() / 4), (float) (getMeasuredHeight() / 2));
            this.path.lineTo((float) (getMeasuredWidth() / 2), (float) ((getMeasuredHeight() * 3) / 4));
            this.path.lineTo((float) getMeasuredWidth(), (float) (getMeasuredHeight() / 4));
            canvas.drawPath(this.path, this.paint);
        }
    }
}
